quartz: fix crash in the recent clipboard "fix", and really fix it
authorMichael Natterer <mitch@lanedo.com>
Fri, 7 Dec 2012 11:19:52 +0000 (12:19 +0100)
committerMichael Natterer <mitch@gimp.org>
Fri, 7 Dec 2012 11:30:15 +0000 (12:30 +0100)
commit9d31a04d129d7bc10f5b5e1922ee919c0063212c
treed97effdb42b40b74ef5f1826eda0b794049cd42b
parent34318b9163b1c2913a8e2dbacf300adc170fd61f
quartz: fix crash in the recent clipboard "fix", and really fix it

We must not release the GtkClipboardOwner in pasteboardChangedOwner
becaue we don't own a reference to ourselves (NSPasteboard does).
Instead, release the owner right after setting it, transferring
ownership to NSPasteboard

Also, fix repeated setting of the same owner by keeping the
owner around in GtkCLipboard, and re-use it if "user_data"
doesn't change. To avoid clipboard_unset()ting our own contents
in the process, add an ugly "setting_same_owner" boolean to
GtkClipboardOwner, set it during re-setting the same owner,
and avoid calling clipboard_unset() from pasteboardChangedOwner
if it's TRUE.
(cherry picked from commit 4a8df7a33c298d22bf78b947d0e861fc03ec70e1)
gtk/gtkclipboard-quartz.c